using System;
using System.Collections;
using System.Resources;
using System.Reflection;

namespace MCMLXVII.Core.Common
{

	/// <summary>
	/// Provides functions to manage localization
	/// </summary>
	public class ResourcesTools
	{

        private static Hashtable _RMCache = new Hashtable();        

        public ResourcesTools()
		{
		}		

		/// <summary>
		/// Replaces the placeholders in the message with the specified parameters list 
		/// </summary>
		/// <param name="stMessage">Base localized message.</param>
		/// <param name="xParameter">Parameters to be replaced in the message. For example "Peter Trempton","Developer",DateTime.Now.ToString()</param>
		/// <returns>merged Message</returns>
		public static string RetornaLocPar(string stMessage, params string[] xParameters)
		{
			for(int i=0;i<xParameters.Length;i++)
			{
				stMessage=stMessage.Replace("{" + i.ToString() + "}",xParameters[i]);
			}		
			return stMessage;

        }
	}
}
